package com.example.sdemo.api.controller;

import com.example.sdemo.app.service.CourseService;
import org.springframework.web.bind.annotation.*;
import com.example.sdemo.domain.entity.Course;
import javax.annotation.Resource;

@RestController
@RequestMapping("/course")
public class CourseController {
    @Resource
    CourseService courseService;

    @PostMapping("/addC")
    public Boolean addC(@RequestBody Course course){
        return courseService.insertC(course);
    }
    @PostMapping("/deleteC/{id}")
    public Boolean delC(@PathVariable Integer id){
        return courseService.deleteC(id);
    }
    @PostMapping("/updateC")
    public Boolean updateC(@RequestBody Course course){
        return courseService.updateC(course);
    }
    @PostMapping("/findC/{id}")
    public String findC(@PathVariable Integer id){
        return courseService.selectCById(id).toString();
    }


}
